/**
 * TestServiceImpl.java
 * com.lyj.demo.springboot.service.impl
 * Function： TODO add descript
 *
 *   ver     date      		author
 * ──────────────────────────────────
 *   		 2017年8月24日       lyj
 *
 * Copyright (c) 2017, TNT All Rights Reserved.
*/

package com.lyj.demo.springboot.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lyj.demo.springboot.mapper.UserMapper;
import com.lyj.demo.springboot.model.User;
import com.lyj.demo.springboot.service.TestService;

/**
 * ClassName:TestServiceImpl
 * Function: TODO ADD FUNCTION
 * Reason:	 TODO ADD REASON
 *
 * @author   lyj
 * @version  
 * @since    version 1.0
 * @Date	 2017年8月24日	下午5:50:32
 *
 * @see 	 
 *  
 */
@Service
public class TestServiceImpl implements TestService {
	
	@Autowired
	UserMapper userMapper;

	/**
	 * (non-Javadoc)
	 * @see com.lyj.demo.springboot.service.TestService#count()
	 */
	@Override
	public Integer count() {
		
		// TODO Auto-generated method stub
		return userMapper.count();
		
	}

	@Override
	public PageInfo<User> page() {
		PageHelper.startPage(1, 2,true);
		
//		PageHelper.startPage(0, 2);
		List<User> list =  userMapper.page();
		PageInfo<User> page = new PageInfo<User>(list);
		// TODO Auto-generated method stub
		return page;
	}

}
